package com.dbutils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class DbTest {
    static Connection connection;
    static ResultSet rs;
    static PreparedStatement ps;
    public static void main(String[] args) {
       getAllCustomer();

    }

    public static void getAllCustomer(){
        try {
            DbInit dbInit = new DbInit();
            connection = dbInit.getConnection();
            String sql = "select * from customer";

            ps = connection.prepareStatement(sql);
            ps.setInt(1,1);
            rs = ps.executeQuery();
            while(rs.next()){
                System.out.println(rs.getString("customer_name"));
            }

        } catch (SQLException e) {
            throw new RuntimeException(e);
        }


    }

    public static void getCustomerById(int customer_id){
        try {

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
